<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl"> 
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <?php if(in_array($this->action->id, array('create', 'update'))):?>
        <td></td>
        <?php endif?>
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <strong class="error text-danger"></strong>
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
        </td>
        <td>
            {% if (!i && !o.options.autoUpload) { %}
                <button class="btn btn-primary btn-small start" disabled><i class="fa fa-upload"></i> <span>Upload</span></button>
            {% } %}
            {% if (!i) { %}
                <button class="btn btn-warning btn-small cancel"><i class="fa fa-ban"></i> <span>Hủy</span></button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>


<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl"> 
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        <?php if(in_array($this->action->id, array('create', 'update'))):?>
        <td>
        {% if (!file.error) { %}
            <input class="image_cover" {% if (file.is_cover == 1) { %} checked = "checked" {% }%}  type="radio" name="cover" value="{%=file.id%}" rel="tooltip" title="Chọn làm ảnh đại diện" />
        {% } %}
        </td>
        <?php endif?>
        <td>
            <span class="preview">
            {% if (file.url_thumb) { %}
                <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.url_thumb%}"></a>
            {% } %}
            </span>
        </td>
        <td>
            {% if (!file.error) { %}
            <p class="name">
                <a href="" title="Chèn ảnh này vào bài viết" url="{%=file.url%}" class="add_to_content btn btn-small btn-primary"><i class="fa fa-external-link"></i> Chèn vào bài</a>
            </p>
            {% } %}
            {% if (file.error) { %}
                <div><span class="label label-danger">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <button class="btn btn-danger btn-small delete" data-type="{%=file.delete_method%}" data-url="{%=file.delete_url%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                <i class="fa fa-trash-o"></i> <span>Xóa</span>
            </button>
        </td>
    </tr>
{% } %}
</script>


<!-- The blueimp Gallery widget -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
    <div class="slides"></div>
    <h3 class="title"></h3>
    <a class="prev">‹</a>
    <a class="next">›</a>
    <a class="close">×</a>
    <a class="play-pause"></a>
    <ol class="indicator"></ol>
</div>

<link rel="stylesheet" href="/files/js/blueimp/jquery.gallery/css/blueimp-gallery.min.css">

<link rel="stylesheet" href="/files/js/blueimp/jquery.file.upload/css/jquery.fileupload.css">
<link rel="stylesheet" href="/files/js/blueimp/jquery.file.upload/css/jquery.fileupload-ui.css">
<noscript><link rel="stylesheet" href="/files/js/blueimp/jquery.file.upload/css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="/files/js/blueimp/jquery.file.upload/css/jquery.fileupload-ui-noscript.css"></noscript>

<!-- The Templates plugin is included to render the upload/download listings -->
<script src="/files/js/blueimp/javascript.templates/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="/files/js/blueimp/javascript.load-image/js/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->         
<script src="/files/js/blueimp/javascript.canvas-to-blob/js/canvas-to-blob.min.js"></script>

<!-- blueimp Gallery script -->
<script src="/files/js/blueimp/jquery.gallery/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="/files/js/blueimp/jquery.file.upload/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="/files/js/blueimp/jquery.file.upload/js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="/files/js/blueimp/jquery.file.upload/js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="/files/js/blueimp/jquery.file.upload/js/jquery.fileupload-image.js"></script>
<!-- The File Upload validation plugin -->
<script src="/files/js/blueimp/jquery.file.upload/js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="/files/js/blueimp/jquery.file.upload/js/jquery.fileupload-ui.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="/files/js/jquery.file.upload/js/cors/jquery.xdr-transport.js"></script>
<![endif]-->

 